import { defineStore } from "pinia";

export const useCounterStore = defineStore("counter", {
  state: () => ({
    data: [
      {
        id: 0,
        name: "看看",
        amount: 2000,
        time: "2013-5-19",
        unit: "壹基金",
        editing: false,
      },
      {
        id: 1,
        name: "dd",
        amount: 3000,
        time: "2013-5-19",
        unit: "中华慈善总会",
        editing: false,
      },
      {
        id: 2,
        name: "看scdsc看",
        amount: 5000,
        time: "2013-5-19",
        unit: "中国扶贫基金会",
        editing: false,
      },
    ],
    unit: ["壹基金", "中华慈善总会", "中国扶贫基金会"],
  }),
  actions: {
    add(id, name, time, un, monery) {
      this.data.push({
        id: id,
        name: name,
        unit: un,
        amount: monery,
        time: time,
      });
    },
  },
});
